#ifndef __MODULE_KEY_H__
#define __MODULE_KEY_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include "fsl_single_key.h"

typedef enum {KEY0 = 0, KEY1, KEY2, KEY_NUM_MAX} key_index_t;

struct key_ops
{
    void (*init)(void);
    uint8_t (*is_click)(uint8_t index);
    uint8_t (*is_double_click)(uint8_t index);
    uint8_t (*is_long_press)(uint8_t index);
    uint8_t (*is_long_release)(uint8_t index);
    uint8_t (*is_valid)(void);
#if FSL_SINGLE_KEY_INDICATE_MODE == FSL_SINGLE_KEY_INDICATE_BRIEF
    void (*register_indicate_callback)(void (*cb)(void));
#endif
};

extern const struct key_ops api_key;


#ifdef __cplusplus
}
#endif

#endif /* __MODULE_KEY_H__ */
